package com.njworkorder.Service.Impl;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.njworkorder.Entity.EngineeringQualityInfo;
import com.njworkorder.Entity.EqiWithTp;
import com.njworkorder.Service.EngineeringQualityInfoService;
import com.njworkorder.Mapper.EngineeringQualityInfoMapper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
* @author iron
* @description 针对表【engineering_quality_info】的数据库操作Service实现
* @createDate 2024-11-25 10:19:00
*/
@Service
public class EngineeringQualityInfoServiceImpl extends MPJBaseServiceImpl<EngineeringQualityInfoMapper, EngineeringQualityInfo>
    implements EngineeringQualityInfoService{


    @Async
    @Override
    public CompletableFuture<List<EqiWithTp>> getAcceptanceInfos(String assignmentId) {

        MPJLambdaWrapper<EngineeringQualityInfo> wrapper = new MPJLambdaWrapper<EngineeringQualityInfo>()
                .selectAll(EqiWithTp.class)
                .rightJoin(EqiWithTp.class,EqiWithTp::getEqiId,EngineeringQualityInfo::getId)
                .eq(EngineeringQualityInfo::getJobManagementId,assignmentId);

        return CompletableFuture.completedFuture(selectJoinList(EqiWithTp.class, wrapper));
    }
}




